package ypmits.videoplayer.view {
	import ypmits.utils.Logger;
	import ypmits.videoplayer.business.Validator;

	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;

	/**
	 * @author ypmits
	 */
	public class VideoControlDummy extends Sprite {
		public var controlbar_width : Number;
		public var controls_playpause : MovieClip;
		public var controls_bufferbar : Sprite;
		public var controls_pasttimebar : Sprite;
		public var controls_playhead : Sprite;
		public var controls_title : TextField;
		public var controls_pasttime : TextField;
		public var controls_togotime : TextField;

		public function VideoControlDummy( controlsprite : DisplayObject, logger : Logger ) {
			var v : Array = Validator.validateControlSprite( controlsprite );
			
			if( v[0] ) {

				controls_playpause = controlsprite['playpausebutton'];
				controls_bufferbar = controlsprite['controlbar']['bufferbar'];
				controls_pasttimebar = controlsprite['controlbar']['pasttimebar'];
				controls_playhead = controlsprite['controlbar']['playhead'];
				controls_title = controlsprite['title'];
				controls_pasttime = controlsprite['timepast'];
				controls_togotime = controlsprite['timetogo'];
				controlbar_width = Sprite( controlsprite['controlbar']['bufferbar'] ).width;
				
			} else {
				for (var i : int = 0; i < v[1].length; i++) {
					logger.log( "validation-error: " + v[1][i], Logger.ERROR );
					logger.ttrace( );
				}
			}
			
			reset();
		}
		
		public function reset() : void {
			controls_playpause.gotoAndStop( 1 );
			controls_bufferbar.scaleX = .001;
			controls_pasttimebar.scaleX = .001;
			controls_playhead.x = 0;
		}
		
	}
}
